<%-- 
    Document   : faq
    Created on : Jul 11, 2011, 7:41:01 PM
    Author     : Hai
--%>

<%@page import="server.entity.Faq"%>
<%@page import="server.process.ProcessBeanLocal"%>
<%@page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<jsp:include page="adminheader.jsp"></jsp:include>
            <div id="main">
                <div id="adminManager">
                   <jsp:include page="lefmenu.jsp"></jsp:include>
                </div>
                <div id="contentAdmin">
                    <fieldset>
                        <legend>FAQ</legend>
                        
                            <h4>
                                <table border="1">
                                    <thead>
                                        <tr>
                                            <th>No</th>
                                            <th>Question</th>
                                            <th>Answer</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <%
                                            Context ctx=new InitialContext();
                                            Object obj=ctx.lookup("ProcessLocalJNDI");
                                            ProcessBeanLocal local=(ProcessBeanLocal)obj;
                                            Faq[] reuslt=local.ShowAllfaq();
                                            for(int i=0;i<reuslt.length;i++){
                                                
                                        %>
                                        <form action="hi">
                                        <tr>
                                            <td><%=i+1%></td>
                                            <td><%=reuslt[i].getQuestion()%></td>
                                            <td><%=reuslt[i].getAnswers()%></td>
                                            <td><input type="submit" name="action" value="Delete"/></td>
                                            <td><input type="submit" name="action" value="Update"/></td>
                                            <td><input type="submit" name="action" value="Add New" /></td>
                                        </tr>
                                        <input type="hidden" name="txtidfaq" value="<%=reuslt[i].getId()%>"/>
                                            <input type="hidden" name="txtquestion" value="<%=reuslt[i].getQuestion()%>"/>
                                                <input type="hidden" name="txtawer" value="<%=reuslt[i].getAnswers()%>"/>
                                       </form>
                                        <% }
                                        %>
                                    </tbody>
                                </table>



                            </h4>
                        
                    </fieldset>
                </div>
            </div>
            <div id="footer">

            </div>
        </div>
    </body>>
</html>
